package com.zhangyang.dubbo.main;

import com.alibaba.dubbo.container.Main;
import com.zhangyang.dubbo.*;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
//        try {
//            System.out.println( "Hello World!" );
//            ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"META-INF/spring/service-provider.xml"});
//            context.start();
//
//            System.in.read();
//
//        } catch (IOException e) {
//            e.printStackTrace();
//        }

//       Main.main(args);

       //测试用户的服务!
        ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(new String[]{"user-consumer.xml"});
        OrderService orderService=(OrderService) context.getBean("orderService");
//        UserLoginRequest userLoginRequest=new UserLoginRequest("root","123456");
//        UserLoginResponse userLoginResponse=iUserService.doLogin(userLoginRequest);
//        orderService.doOrder(new RequestCode("12323",null));
//        System.out.println("userLoginResponse:"+userLoginResponse.toString());

//        OrderService orderService=(OrderService)context.getBean("orderService");
        ResponseCode responseCode=orderService.doOrder(new RequestCode("12321321","请求！"));
        System.out.println("ResponseCode: "+responseCode);
    }
}
